extends "res://GameScenes/FunctionPropScene/BaseProp/BaseProp.gd"

func _init() -> void:
	prop_id = "Zhong"

func _ready() -> void:
	prop_name = "很中"
	self_destruction = false
	self_description = "结算结束后,手牌中每有一张红中，倍率便额外+3"
	trigger_timing = 3
	detail_label.text = self_description
	hover_detail_label.text = self_description
	if self.get_parent():
		var parent = self.get_parent()
		if parent.name == "PlayerProps":
			detail_label.visible = false
		else:
			detail_label.visible = true

func propFunction(deck,scoreMapping,selectedCardsDetail):
	var parent = self.get_parent()
	var grandParent = parent.get_parent()
	var timer = grandParent.timer
	var handMahjongId = grandParent.handConst
	for id in handMahjongId:
		var idStr = id.split("_")[0] + "_" + id.split("_")[1]
		if idStr == "hongzhong_1":
			showRunDetail()
			timer.start() #启动计时器
			await timer.timeout # 等待
			grandParent.playingMagnification += 3
			grandParent.updatePlayingMagnificationLabel()
			hideRunDetail()
			timer.start() #启动计时器
			await timer.timeout # 等待
